{% extends "base_generic.html" %}
{% block script %}
<script type="text/javascript">
  $(window).load(
    function() {
      $( "#avDate" ).datepicker({ dateFormat: 'yy-mm-dd 00:00:00.000000' });
    });
</script>
{% endblock %}
{% block content %}
        <h1>Joke</h1>
        <form action="/admin/jokes/{{ jokeKey }}/save/" method="post">
        
        <div class="line">
          <div class="field">
            <label>Title:</label>
            <input id="title" title="title" type="text" name="title" size="65" value="{{ title }}" />
          </div>
          <div class="field">
            <label>Author</label>
            <input id="author" title="author" type="text" name="author" size="20" value="{% if author %}{{ author }}{% else %}triton{% endif %}" />
          </div>
         </div>
         <div class="line">
           <div class="field">
             <label>Joke:</label>
             <textarea cols="90" rows="12" id="text" name="text">{{ text }}</textarea>
           </div>
        </div>
        <div class="line">
           <div class="field" id="categories">
             {% for tag in tags %}
              <label>
                <input type="checkbox" value="{{ tag.slug }}" name="tag"
                {% for jokeTag in jokeTags %}
                  {% ifequal tag.slug jokeTag %} checked="checked"{% endifequal %}
                {% endfor %}
                /> {{ tag.name }}</label>
             {% endfor %}
           </div>
        </div>
        <input type="hidden" title="codenum" id="codenum" value="{{ filekey }}" />
        <input type="submit" value="Guardar" id="save" name="save" title="save" /><br class="clear" />
      </form>
      <br class="clear" />

{% endblock %}
      